#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iterator>

#include <cstdio>
#include <ctime>
#include <cstring>
#include <cmath>
#include <cstdlib>

#define REP(i,n) for (int i=0,_n=(n); i < _n; i++)
#define REPD(i,n) for (int i=(n)-1; i >= 0; i--)
#define FOR(i,a,b) for (int _b=(b), i=(a); i <= _b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;i--)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))

#define CLEAR(x) memset(x,0,sizeof x);
#define CLEARA(x) memset(&x,0,sizeof x);
#define FILL(x,v) memset(x,v,sizeof x);
#define FILLA(x,v) memset(&x,v,sizeof x);

#define VAR(a,b) __typeof(b) a=(b)
#define FOREACH(it,c) for(VAR(it,(c).begin());it!=(c).end();++it)

#define REVERSE(c) reverse(ALL(c))
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define INF 0x7fffffff
#define X first
#define Y second
#define pb push_back
#define SZ(c) (int)(c).size()
#define MP make_pair
#define eps 1.0e-11

const double pi = acos(-1.0);

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<pii> vpii;
typedef unsigned long long ull;

int main() {

	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);

	int kralj, kraljica, lovac, konj, top, pesak;

	scanf("%d %d %d %d %d %d", &kralj, &kraljica, &lovac, &konj, &top, &pesak);

	printf("%d %d %d %d %d %d\n", 1 - kralj, 1 - kraljica, 2 - lovac, 2 - konj,
			2 - top, 8 - pesak);


	/* tp generator

	freopen("input.in", "w", stdout);

	printf("100\n");
	for (int i = 0; i < 99; i++) {
		if (i + 1 == 99)
			printf("2 %d 2 100\n", i + 1);
		else
			printf("1 %d\n", i + 1);
	}

	printf("0\n");

	*/

	return 0;
}

